• Drag Up Key from and drop it at the bottom of your program.
  • Change the up_key() event so that whenever the up key is pressed:
    • The hedgehog moves forward 575 steps
    • The stage waits 0.1 seconds
    • The sprite goes back to (0, -210). 3, 2, 1.... Launch!

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("moon") sprite = codesters.Sprite("hedgehog") sprite.go_to(0, -210) def left(): sprite.turn_left(20) stage.event_left_key(left) def right(): sprite.turn_right(20) stage.event_right_key(right)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)